FSI API: Page Related Methods

Page parameters

You can add page parameters as key-value pairs to a page in your web application; these parameters are available to other pages when you navigate away from the page. They can also be set or retrieved using the web page Layout > Page Parameters, but with the limitation that you must use a control to set or retrieve the values; see Page Layout Properties.

fsi.pageParameter(<key>,<value>); Defines a page parameter in a web application page.
fsi.pageParameter(<key>); Returns a page parameter in a web application page.
fsi.removeParameter(<key>); Removes a page parameter from the web application page.

This example adds a page parameter to one page:

function setPageParam(){
var key='myName';
var value='John';
 fsi.pageParameter(key,value);
}

and retrieves it in another page for display in a text box:

function getPageParam(){
//Retrieve the parameter:
var paramValue=fsi.pageParameter('myName'); 
fsi.setById('textbox-1',paramValue );
}

Use can also use Store.js: Browser Storage for web browser storage.

Page navigation

fsi.changePage(<page name>); Directs the browser to the named page. 
fsi.redirectPage(<page name>); Redirects the browser to the named page.

ExampleUses the value of a global variable to supply the redirect page name.

function Testing() {
 fsi.redirectPage(fsi.globalVariable('PageNavigation'));
}
fsi.goBack(); Directs the browser to the previous page.
fsi.refreshPage(); Refreshes the page.
fsi.getLastPage(); Returns the name of the last page loaded.
fsi.basePath() Returns the base path URL of the current page.
fsi.goToDashboard() Directs the browser to the MRI Dreamscape Dashboard.

Forms

The term form is often applied to a page when the page is bound to a data object, and you are mapping controls in the page directly to fields in the data object. In this way you can create a form that a user can complete using text boxes, number boxes, data pickers, and so on. When the form is saved, the data object is updated.

fsi.clearForm() Clears the current form data.
fsi.saveForm(success Callback, error Callback); Saves the current form data to a row in the data object specified in layout properties. The optional callbacks specify JavaScript functions to handle success or failure conditions. Has the same effect as a button control of type Save.
fsi.deleteFormData(success Callback, error Callback); Deletes the current data row from the data object. The optional callbacks specify JavaScript functions to handle success or failure conditions. Has the same effect as a button control of type Delete.
fsi.formId; Returns the form (page) id.

Query string

For mobile devices, you can use this method to retrieve values passed in a URL query string. When a push notification is sent to a mobile device and clicked by the user, it's possible to force a redirect to another page in the application; the query string provides a method to pass parameters to the new page.

See also PushNotification Node.

Note | You must match the case used for the parameter names exactly.

fsi.getQuerystringValue().<key> Returns the value of the query string parameter identified by "key".

Example

http://example.com/page?name=ferret&colour=purple

You return the query string parameters in this URL using:

fsi.getQuerystringValue().name and fsi.getQuerystringValue().colour.

Spinner

fsi.autoAjaxSpinner = <boolean>; When set false, the spinner is suppressed for AJAX calls. It would normally be set in Global JavaScript to be active across all pages in a web application.
fsi.showSpinner(<hex/css colour>); Displays a loading spinner in the colour specified.If no colour specified, the spinner takes the application’s primary colour.
fsi.hideSpinner(); Hides the loading spinner.